package cn.lzt.test

import java.io.{InputStream, ObjectInputStream}
import java.net.{ServerSocket, Socket}

object Executor1 {
  def main(args: Array[String]): Unit = {
    val server: ServerSocket = new ServerSocket(9999)
    println("服务器创建成功，等待客户端发送数据...")
    val client : Socket = server.accept()
    val inputStream:InputStream = client.getInputStream
    val objectInputStream = new ObjectInputStream(inputStream)
    val value:AnyRef = objectInputStream.readObject()
    val task:Task1 = value.asInstanceOf[Task1]
    val data: List[Int]  = task.com()
    println("结束到客户端的数据："+ data)
    objectInputStream.close()
    inputStream.close()
    client.close()
    server.close()
    }


}
